# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1112 -> 1.1113 # arch/i386/kernel/process.c 1.49 -> 1.50 # include/asm-alpha/hw_irq.h 1.2 -> 1.3 # include/linux/sched.h 1.143 -> 1.144 # arch/i386/kernel/traps.c 1.52 -> 1.53 # arch/alpha/kernel/traps.c 1.24 -> 1.25 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/06/03 davidm@wailua.hpl.hp.com 1.1113 # Adjust show_trace()/show_stack() interfce to make them truly portable: # first arg is task whose trace should be shown, second arg is stack # pointer value starting from which the trace should be shown. Either # (or both) arguments can be NULL. # -------------------------------------------- # diff -Nru a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c --- a/arch/alpha/kernel/traps.c Sun Jun 8 00:40:41 2003 +++ b/arch/alpha/kernel/traps.c Sun Jun 8 00:40:41 2003 @@ -148,7 +148,7 @@ static int kstack_depth_to_print = 24; -void show_stack(unsigned long *sp) +void show_stack(struct task_struct *task, unsigned long *sp) { unsigned long *stack; int i; @@ -174,7 +174,7 @@ void dump_stack(void) { - show_stack(NULL); + show_stack(NULL, NULL); } void diff -Nru a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c --- a/arch/i386/kernel/process.c Sun Jun 8 00:40:41 2003 +++ b/arch/i386/kernel/process.c Sun Jun 8 00:40:41 2003 @@ -190,7 +190,7 @@ ".previous \n" : "=r" (cr4): "0" (0)); printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", cr0, cr2, cr3, cr4); - show_trace(®s->esp); + show_trace(NULL, ®s->esp); } /* diff -Nru a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c --- a/arch/i386/kernel/traps.c Sun Jun 8 00:40:41 2003 +++ b/arch/i386/kernel/traps.c Sun Jun 8 00:40:41 2003 @@ -92,15 +92,13 @@ static int kstack_depth_to_print = 24; -void show_trace(struct task_struct *task) +void show_trace(struct task_struct *task, unsigned long * stack) { int i; - unsigned long addr, *stack; + unsigned long addr; - if (!task) - stack = (unsigned long*)&task; - else - stack = (unsigned long *) task->thread.esp; + if (!stack) + stack = (unsigned long*)&stack; printk("Call Trace:"); #if CONFIG_KALLSYMS @@ -124,21 +122,19 @@ /* User space on another CPU? */ if ((esp ^ (unsigned long)tsk->thread_info) & (PAGE_MASK<<1)) return; - show_trace(tsk); + show_trace(tsk, (unsigned long *)esp); } -void show_stack(struct task_struct *task) +void show_stack(struct task_struct *task, unsigned long * esp) { - unsigned long *stack, *esp; + unsigned long *stack; int i; // debugging aid: "show_stack(NULL);" prints the // back trace for this cpu. - if(task==NULL) - esp=(unsigned long*)&task; - else - esp = (unsigned long*)task->thread.esp; + if(esp==NULL) + esp=(unsigned long*)&esp; stack = esp; for(i=0; i < kstack_depth_to_print; i++) { @@ -149,7 +145,7 @@ printk("%08lx ", *stack++); } printk("\n"); - show_trace(task); + show_trace(task, esp); } /* @@ -157,7 +153,9 @@ */ void dump_stack(void) { - show_trace(NULL); + unsigned long stack; + + show_trace(current, &stack); } void show_registers(struct pt_regs *regs) @@ -194,7 +192,7 @@ if (in_kernel) { printk("\nStack: "); - show_stack(NULL); + show_stack(NULL, (unsigned long*)esp); printk("Code: "); if(regs->eip < PAGE_OFFSET) diff -Nru a/include/asm-alpha/hw_irq.h b/include/asm-alpha/hw_irq.h --- a/include/asm-alpha/hw_irq.h Sun Jun 8 00:40:41 2003 +++ b/include/asm-alpha/hw_irq.h Sun Jun 8 00:40:41 2003 @@ -13,4 +13,6 @@ #define ACTUAL_NR_IRQS NR_IRQS #endif +extern irq_desc_t irq_desc [NR_IRQS]; + #endif diff -Nru a/include/linux/sched.h b/include/linux/sched.h --- a/include/linux/sched.h Sun Jun 8 00:40:41 2003 +++ b/include/linux/sched.h Sun Jun 8 00:40:41 2003 @@ -148,8 +148,8 @@ extern void init_idle(task_t *idle, int cpu); extern void show_state(void); -extern void show_trace(struct task_struct *); -extern void show_stack(struct task_struct *); +extern void show_trace(struct task_struct *, unsigned long *); +extern void show_stack(struct task_struct *, unsigned long *); extern void show_regs(struct pt_regs *); void io_schedule(void);